package xyz.ddlnt.serviceusrclient.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import xyz.ddlnt.commonutil.result.Result;
import xyz.ddlnt.model.dto.PageDTO;
import xyz.ddlnt.model.dto.PostDescriptionDTO;
import xyz.ddlnt.model.dto.SearchDTO;
import xyz.ddlnt.model.vo.PostLatestVO;
import xyz.ddlnt.model.vo.PostNodeVO;
import xyz.ddlnt.model.vo.PostVO;

import java.util.List;

/**
 * @author ZZULI_SE 210910
 * @data 2025/5/9 19:55
 */
//@FeignClient(name = "service-usr", url = "http://yixuewang-service-usr:9015", path = "/post")
//@FeignClient(name = "service-usr", url = "http://localhost:9005", path = "/post")
@FeignClient(value = "service-usr", path = "/post")
public interface PostFeignClient {
    /**
     * 发布帖子
     * @param postDescriptionDTO
     * @return
     */
    @PostMapping("/PublishPost")
    Result<Boolean> PublishPost(@RequestBody PostDescriptionDTO postDescriptionDTO);

    /**
     * 查询帖子列表
     * @return
     */
    @PostMapping("/getPostLists")
    Result<List<PostVO>> getPostLists(@RequestBody PageDTO pageDTO);

    /**
     * 搜索帖子
     * @param searchDTO
     * @return
     */
    @PostMapping("/searchPost")
    Result<List<PostVO>> searchPostList(@RequestBody SearchDTO searchDTO);

    /**
     * 获取帖子信息
     * @param id
     * @return
     */
    @GetMapping("/getPost")
    Result<PostVO> getPost(@RequestParam Long id);

    /**
     * 查询博主最新发布列表
     * @return
     */
    @PostMapping("/getBloggerPublish")
    Result<List<PostVO>> getBloggerPublish(@RequestBody PageDTO pageDTO);

    /**
     * 查询博主最新发布列表
     * @param bloggerId
     * @return
     */
    @GetMapping("/getPostLatestList")
    Result<List<PostLatestVO>> getPostLatestList(@RequestParam Long bloggerId);

    /**
     * 查询帖子目录和节点信息
     * @param postId
     * @return
     */
    @GetMapping("/getPostNodeInfo")
    Result<PostNodeVO> getPostNodeInfo(@RequestParam Long postId);
}
